package com.kehutong.employee.entity;

import java.util.Collections;
import java.util.List;

import org.coraframework.bean.valid.CheckField;
import org.coraframework.json.JSONObject;
import org.coraframework.orm.Entity;
import org.coraframework.orm.annotation.Column;
import org.coraframework.orm.annotation.Table;
import org.coraframework.orm.annotation.UnSave;
import org.coraframework.orm.util.IDType;
import org.coraframework.util.Objects;

import com.kehutong.common.enums.Gender;
import com.kehutong.employee.enums.Identity;
import com.kehutong.employee.enums.Status;
import com.kehutong.employee.enums.Type;


/**
 * 员工
 * @author liuzhen (liuxing521a@163.com)
 * @createTime 2020年7月14日下午7:12:20
 */
@Table(value="t_member_employee", multi=true, idType=IDType.TIMESTAMP,isSyncGenerateTable = true)
public class Employee extends Entity {
	private static final long serialVersionUID = -6100721690681565264L;

	protected Employee(String id) {
		super(id);
		this.enable = true;
	}

	@Column(length=255,comment = "员工个人二维码")
	private String qrCode;

	@CheckField("姓名不能为空")
	@Column(comment="姓名")
	private String name;

	@Column(comment="别名")
	private String alias;

	@Column(comment="账号-用户唯一id")
	private String userid;

	@Column(comment="性别。0表示未定义，1表示男性，2表示女性")
	private Gender gender;
	
	@CheckField("员工手机不能为空")
	@Column(comment="手机")
	private String mobile;

	@Column(comment="座机")
	private String telephone;

	@Column(length=127, comment="邮箱")
	private  String email;

	@Column(length=64, comment="地址")
	private String address;

	/**
	 *  员工所属部门
	 */
	@CheckField("部门不能为空")
	@Column(comment="部门id")
	private List<String> department;

	/**
	 *  员工所属部门
	 */
	@Column(comment="部门名称")
	private List<String> departmentName;

	/**
	 *	上级管家 职责部门
	 */
	@Column(comment="负责部门id")
	private List<String> dutyDepartment;

	/**
	 *	上级管家 职责部门
	 */
	@Column(comment="负责部门名称")
	private List<String> dutyDepartmentName;

	@Column(comment="角色id")
	private List<String> roleId;

	@Column(comment="角色名称")
	private List<String> roleName;

	@Column(comment="职务编号")
	private List<String> positionNos;

	@UnSave
	private List<String> positionNames;

	@UnSave
	private List<String> positionDepartment;

	@Column(comment = "身份")
	private Identity identity;

	@Column(comment = "办公地点")
	private String officeAddress;

	@Column(comment = "入职时间")
	private String entryDate;

	@Column(comment = "员工类型")
	private Type type;

	@Column(comment = "员工状态")
	private Status status;

	@Column(comment = "备注")
	private String remark;

	@Column(defValue = "NOT NULL default '1' ", comment = "状态 true: 可用; false: 禁用")
	private boolean enable;

	@Column(comment="逻辑删除")
	private boolean deleted;

	@Column(comment="排序")
	private long sort;

	@Column(comment="姓名")
	private String thirdName;

	@Column(length=255, comment="头像")
	private String avatar;

	@UnSave
	private String depName;

	@UnSave
	private String dutyDepName;

	@UnSave
	private String roleTemp;

	@UnSave
	private List<JSONObject> dutyDepartmentList;

	@UnSave
	private List<JSONObject> departmentList;

	@UnSave
	private String build;

	@Column(comment = "管理部门id")
	private List<String> manageDepartmentNo;

	public List<String> getManageDepartmentNo() {
		return manageDepartmentNo;
	}

	public void setManageDepartmentNo(List<String> manageDepartmentNo) {
		this.manageDepartmentNo = manageDepartmentNo;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAlias() {
		return alias;
	}

	public void setAlias(String alias) {
		this.alias = alias;
	}

	public String getUserid() {
		return userid;
	}

	public void setUserid(String userid) {
		this.userid = userid;
	}

	public Gender getGender() {
		return gender;
	}

	public void setGender(Gender gender) {
		this.gender = gender;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public List<String> getDepartment() {
		if (Objects.isNull(department)) {
			return Collections.emptyList();
		}
		return department;
	}

	public void setDepartment(List<String> department) {
		this.department = department;
	}

	public List<String> getDepartmentName() {
		return departmentName;
	}

	public void setDepartmentName(List<String> departmentName) {
		this.departmentName = departmentName;
	}

	public List<String> getRoleId() {
		return roleId;
	}

	public void setRoleId(List<String> roleId) {
		this.roleId = roleId;
	}

	public List<String> getRoleName() {
		return roleName;
	}

	public void setRoleName(List<String> roleName) {
		this.roleName = roleName;
	}

	public Identity getIdentity() {
		return identity;
	}

	public void setIdentity(Identity identity) {
		this.identity = identity;
	}

	public String getOfficeAddress() {
		return officeAddress;
	}

	public void setOfficeAddress(String officeAddress) {
		this.officeAddress = officeAddress;
	}

	public String getEntryDate() {
		return entryDate;
	}

	public void setEntryDate(String entryDate) {
		this.entryDate = entryDate;
	}

	public Type getType() {
		return type;
	}

	public void setType(Type type) {
		this.type = type;
	}

	public Status getStatus() {
		return status;
	}

	public void setStatus(Status status) {
		this.status = status;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public boolean isDeleted() {
		return deleted;
	}

	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}

	public String getDepName() {
		return depName;
	}

	public void setDepName(String depName) {
		this.depName = depName;
	}

	public String getRoleTemp() {
		return roleTemp;
	}

	public void setRoleTemp(String roleTemp) {
		this.roleTemp = roleTemp;
	}

	public String getBuild() {
		return build;
	}

	public void setBuild(String build) {
		this.build = build;
	}

	public List<String> getDutyDepartment() {
		if (Objects.isNull(dutyDepartment)) {
			return Collections.emptyList();
		}
		return dutyDepartment;
	}

	public void setDutyDepartment(List<String> dutyDepartment) {
		this.dutyDepartment = dutyDepartment;
	}

	public List<String> getDutyDepartmentName() {
		return dutyDepartmentName;
	}

	public void setDutyDepartmentName(List<String> dutyDepartmentName) {
		this.dutyDepartmentName = dutyDepartmentName;
	}

	public String getDutyDepName() {
		return dutyDepName;
	}

	public void setDutyDepName(String dutyDepName) {
		this.dutyDepName = dutyDepName;
	}

	public List<JSONObject> getDutyDepartmentList() {
		return dutyDepartmentList;
	}

	public void setDutyDepartmentList(List<JSONObject> dutyDepartmentList) {
		this.dutyDepartmentList = dutyDepartmentList;
	}

	public boolean isEnable() {
		return enable;
	}

	public void setEnable(boolean enable) {
		this.enable = enable;
	}

	public String getThirdName() {
		return thirdName;
	}

	public void setThirdName(String thirdName) {
		this.thirdName = thirdName;
	}

	public long getSort() {
		return sort;
	}

	public void setSort(long sort) {
		this.sort = sort;
	}

	public String getAvatar() {
		return avatar;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	public List<JSONObject> getDepartmentList() {
		return departmentList;
	}

	public void setDepartmentList(List<JSONObject> departmentList) {
		this.departmentList = departmentList;
	}

	public List<String> getPositionDepartment() {
		return positionDepartment;
	}

	public List<String> getPositionNos() {
		return positionNos;
	}

	public void setPositionDepartment(List<String> positionDepartment) {
		this.positionDepartment = positionDepartment;
	}

	public void setPositionNos(List<String> positionNos) {
		this.positionNos = positionNos;
	}

	public List<String> getPositionNames() {
		return positionNames;
	}

	public void setPositionNames(List<String> positionNames) {
		this.positionNames = positionNames;
	}

	public String getQrCode() {
		return qrCode;
	}

	public void setQrCode(String qrCode) {
		this.qrCode = qrCode;
	}
}
